<template>

<div class="category-container">
    <div class="flex-xbt">
        <router-link to="/mall/goods/detail" class="category-item" v-for="item in 4">
            <img src="" alt="佰茵商城" />
            <div class="goods-font-wrap">
                <p class="tit">
                    <b>自营</b>
                    这是商品名这是商品名这是商品名这是商品名这是商品名这是商品名这是商这是商商.....
                </p>
                <div class="tip-wrap flex-yc">
                    <span>限时直降100</span>
                    <span>6期0利息分期</span>
                    <span>赠积分</span>
                </div>
                <div class="flex-xbt price-wrap">
                    <span class="flex">
                        <b>￥</b>
                        999.00
                    </span>
                    <el-icon>
                        <ShoppingCart @click.prevent="addCartmodal"/>
                    </el-icon>
                </div>
            </div>
        </router-link>
    </div>
    <dialog-comp
        v-model="isShowcar"
        title="详情"
        submitTxt=""
        width="480px"
        :footer="false"
        :center="true"
        class="carinfo"
        top="100px"
    >
    <div class="felxwaper">
        <div> 
            <CircleCheckFilled style="width: 110px; height: 110px; margin-right: 8px;color: #52C41A;" />
        </div>
        <div class="tit">成功加入购物车</div>
        <div>
            <el-button type="info" class="info" @click="isShowcar=false">在逛逛</el-button>
            <el-button type="primary" class="primary" @click="golink">去结算</el-button>
        </div>
    </div>
  </dialog-comp>
</div>

</template>

<script setup lang="ts" >
import { Search } from '@element-plus/icons-vue'
import Breadcrumb from '@/pages/mall/components/BreadcrumbCom.vue'
import DialogComp from '@/components/dialog/index.vue'
import { ref } from 'vue'
import {  useRouter } from 'vue-router'
const router = useRouter()
const isShowcar = ref(false)

const addCartmodal=()=>{
    isShowcar.value=true
  
}
const golink=()=>{
    console.log(11)
    isShowcar.value=false;
    router.push('/mall/goods/car')
}

</script>

<style lang="scss" scoped>

.category-container {
    width: 100%;
    .input-searchva{
        max-width: 600px;
        min-width: 400px;
    }
    .flex-xbt {
        .category-item {
            width: 310px;
            background-color: #fff;

            &:hover {
                box-shadow: rgb(0 0 0 / 10%) 0 0 36px;
            }

            >img {
                display: block;
                width: 310px;
                height: 220px;
                background-color: #d9d9d9;
            }

            .goods-font-wrap {
                padding: 10px;

                .tit {
                    font-size: 14px;
                    line-height: 16px;
                    color: #5f6085;

                    >b {
                        flex-shrink: 0;
                        padding: 0 2px;
                        font-size: 11px;
                        color: #fff;
                        background-color: $primary;
                        border-radius: 2px;
                    }
                }

                .tip-wrap {
                    margin: 9px 0 17px;

                    span {
                        padding: 2px 4px;
                        font-size: 12px;
                        color: $danger;
                        border: 1px solid $danger;
                        border-radius: 2px;

                        &+span {
                            margin-left: 4px;
                        }
                    }
                }

                .price-wrap {
                    font-size: 18px;
                    color: $danger;

                    span {
                        align-items: flex-end;
                        color: $danger;
                    }

                    b {
                        font-size: 13px;
                    }
                }
            }
        }
    }
}
.carinfo{
    ::v-deep .el-dialog {
        border-radius: 20px;
    }
}
.felxwaper{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    .tit{
        margin: 22px 0px;
        color: #000;
        font-weight: 550;
        font-size: 16px;
    }
    .info{
        background-color: #F2F3F5;
        color: #333;
        border: none;
    }
    .primary{
        border: none;
        background-color: #165DFF;
        color: #fff;
    }
}
</style>
